<p>Vals的值:@string.Join(",",Vals)</p><br>
<Tree Color="Color.Danger" Data="data1" ShowCheckBox @bind-Values="Vals">
</Tree>

@code{
    
    HashSet<string> Vals = new HashSet<string>();
    //下面为了方便，直接从json文件加载数据
    static string dataFile = "Pages/data/data2.json";
    List<TreeItem<string>> data1 = Tree<string>.BuildDataFromJson(System.IO.File.ReadAllText(dataFile));
}